package com.jemmyee.core.service;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import com.jemmyee.core.dao.Page;

/**
 * @Description:所有Service的基类
 * @author:jemmyee@gmail.com
 * @date:2010-10-20
 * @version:v1.0
 */
public interface IBaseService<T> {

    public void save(T entity);
	
	public void delete(T entity);
	
	public void deleteById(Serializable id);
	
	public void update(T entity);

	public T findById(Serializable id);
	
	public List<T> findAll();
	
	public List<T> findByProperty(String propertyName, Object value);
	
	public List<T> findByCriteria(final DetachedCriteria criteria);
	
	public Page findPageByCriteria(final DetachedCriteria detachedCriteria,
			final int pageSize, final int startIndex,final String order);

	public void deleteAll(List<T> list);
}
